import request from '../utils/request';
import host from '../utils/constant';

export async function statisticArticleCount() {
  const requestUrl = `${host}/workspace/statisticArticleCount`;
  return request(requestUrl);
}

export async function statisticBaiJiaCount() {
  const requestUrl = `${host}/workspace/statisticBaiJiaCount`;
  return request(requestUrl);
}

export async function statisticArticleGroup() {
  const requestUrl = `${host}/workspace/statisticArticleGroup`;
  return request(requestUrl);
}

export async function statisticBaiJiaGroup() {
  const requestUrl = `${host}/workspace/statisticBaiJiaGroup`;
  return request(requestUrl);
}

export async function statisticHotSearch() {
  const requestUrl = `${host}/workspace/statisticHotSearchCount`;
  return request(requestUrl);
}

export async function statisticHotTopic() {
  const requestUrl = `${host}/workspace/statisticHotTopicCount`;
  return request(requestUrl);
}

export async function statisticArticleRank(params) {
  const { startDate, endDate } = params;
  const requestUrl = `${host}/workspace/listArticleTop?startDate=${startDate}&endDate=${endDate}`;
  return request(requestUrl);
}

export async function statisticBaiJiaRank(params) {
  const { startDate, endDate } = params;
  const requestUrl = `${host}/workspace/listBaiJiaTop?startDate=${startDate}&endDate=${endDate}`;
  return request(requestUrl);
}

export async function statisticCategoryRatio() {
  const requestUrl = `${host}/workspace/statisticCategoryRatio`;
  return request(requestUrl);
}

